<?php
include dirname(dirname(__FILE__)).'/'.'BaseDao.php';
abstract class BaseDaoImpl implements BaseDao{
	protected $db_type;
	protected $db_host;
	protected $db_name;
	protected $db_user;
	protected $db_pwd;
	protected $db_port;
	protected $db_charset;
	private $config;
	
	
    function __construct($configFilePath){
    	$this->config=include $configFilePath;
		//读取数据库配置
		$this->db_type=$this->get("DB_TYPE");
		$this->db_host=$this->get("DB_HOST");
		//数据库名称
		$this->db_name=$this->get("DB_NAME");
		//用户名
		$this->db_user=$this->get("DB_USER");
		$this->db_pwd=$this->get("DB_PWD");
		$this->db_port=$this->get("DB_PORT");
		$this->db_charset=$this->get("DB_CHARSET");
	}
    public function get($nameStr){
		 $config=$this->config;
		 return $config[$nameStr];
	}
}
?>